<!-- model的公共组件：增删改查; 支持的props可以参考 public/mixins/modelMixin.js -->
<template>
  <instance
      :title="title"
      :type="type"
      :prefix="prefix"
      :config="config"
      :computedConfig="computedConfig"
      @handleDbClick="(row, index) => $emit('handleDbClick', row, index)"
  />
</template>

<script>
import Instance from "@/pages/containerModelDesign/parts/instance";
export default {
  components: {Instance},
  data() {
    return {
      type:'statistics',
      prefix: 'statistics',
      config: {
        deleteById: true,
        modalConfig: {
          hasFeatures: false,
        },
        tableConfig: {
          queryById: true,
          additionalAction: {
            show: false
          }
        }
      }
    }
  },
  computed: {
    computedConfig() {
      return {
        columns: [
            {
              key: 'type',
              title: this.$t(`model.type`),
              minWidth: 100,
              align: 'center',
              show: true
            },
            {
              key: 'className',
              title: this.$t(`model.className`),
              minWidth: 100,
              align: 'center',
              show: true
            },
            {
                key: 'name',
                title: {
                    'zh-CN': '实例名',
                    'en-US': 'instance name'
                }[this.G_Locale],
                minWidth: 100,
                align: 'center',
                show: true
            },
          // {
          //   key: 'version',
          //   title: this.$t(`model.version`),
          //   minWidth: 50,
          //   align: 'center',
          //   show: true,
          // },
          // {
          //   key: 'published',
          //   title: this.$t(`model.published`),
          //   minWidth: 50,
          //   align: 'center',
          //   show: true
          // },
          {
            key: 'createTime',
            title: this.$t(`model.createTime`),
            minWidth: 112,
            align: 'center',
            show: true,
          },
          {
            key: 'updateTime',
            title: this.$t(`model.updateTime`),
            minWidth: 112,
            align: 'center',
            show: true,
          },
        ],
      }
    },
    title() {
      return {
        'zh-CN': `统计实例管理`,
        'en-US': `statistics model instance management`
      }[this.G_Locale]
    },
  },
}
</script>
